<?php

require_once './data/users.php';

//Logined user
if (isset($_POST['login'])) {
    $co=false;
  for($i=0;$i<count($users);$i++)
  {
    if(strcmp($_POST["username"],$users[$i]["username"])==0 &&  strcmp($_POST["password"],$users[$i]["password"])==0)
    {
      $co=true;
      break;
    }
    else
    {
        $co=false;
    }
  }
  
  if($co==true)
  {
      echo "ban da dan nhap thanh cong";
      
  }
 else {
  echo "ban dang nhap chua thanh cong, dang nhap lai !!!";    
  }
}
?>
